package top.tenebrous.termbor.rpc.consumer.nativeTest.consumer;

import lombok.SneakyThrows;
import top.tenebrous.termbor.rpc.api.HelloService;
import top.tenebrous.termbor.rpc.consumer.RpcClient;

/**
 * @program: termbor-rpc
 * @description:
 * @author: yazhang6
 * @create: 2024-05-21 14:23
 **/
public class ConsumerStartup {

    @SneakyThrows
    public static void main(String[] args) throws InterruptedException {
        RpcClient rpcClient = new RpcClient("124.222.198.3:8848","nacos", "randomWeight","cglib","1.0.0", "jestic", "hessian2", 3000, false, false);
        HelloService helloService = rpcClient.create(HelloService.class);
        for (int i = 0; i < 100; i++) {
            String result = helloService.sayHello("zhangsan " + "_" + i);
            System.out.println("服务消费者接收到的数据 ===> " + result);
        }
        rpcClient.shutdown();

    }
}
